<template>
	<view>
		<!-- #ifdef MP || APP-PLUS -->
<!--		<NavBar titleText="租赁订单详情" :iconColor="iconColor" :textColor="iconColor" :isScrolling="isScrolling" showBack></NavBar>-->
		<!-- #endif -->
		<view class="headerBg">
			<view :style="{ height: `${getHeight.barTop}px` }"></view>
			<view :style="{ height: `${getHeight.barHeight}px` }"></view>
			<view class="inner"></view>
		</view>
		<view class="order-details pos-order-details" >
<!--      订单状态-->
			<view class="header" v-if="orderInfo.status_name">
        <view class="state">{{ orderInfo.status_name.status_name }}</view>
        <view class="state" style="font-size: 30rpx" v-if="orderInfo.status_name.second_status_name">
          {{ orderInfo.status_name.second_status_name }}
        </view>
			</view>
<!--      地址-->
			<view class="address" v-if="orderInfo.product_type==0 && orderInfo.uid&&orderInfo.type!=10">
				<view class="name">
					<text class="iconfont icon-ic_location4"></text>
					{{ orderInfo.real_name}}
					<text class="phone">{{ orderInfo.user_phone }}</text>
				</view>
        <view>收货地址：{{ orderInfo.user_address }}</view>
        <view>下单定位：<text style="color: red">{{ orderInfo.current_address }}</text></view>
        <view class="edit-box" v-if="showBtn('address',orderInfo)">
          <view class="btn cancel" @click="showModel('addressShow')">编辑</view>
        </view>
				<view class="line">
					<image src="/static/images/line.jpg" />
				</view>
			</view>
<!--      用户信息-->
			<view class="acea-row row-middle user-box">
				<image v-if="orderInfo.uid" :src="userInfo.avatar" class="image"></image>
				<image v-else src="/static/images/f.png" class="image"></image>
				<view class="text">
					<view class="acea-row row-middle name">
						{{orderInfo.uid?userInfo.nickname:'游客'}}
						<view v-if="userInfo.isMember" class="svip">SVIP</view>
						<view v-if="userInfo.level_grade" class="grade acea-row row-middle"><text class="iconfont icon-huiyuandengji"></text>V{{userInfo.level_grade}}</view>
					</view>
					<view v-if="userInfo.phone" class="">{{userInfo.phone}}（ID:{{userInfo.uid}}）</view>
					<view v-else class="">ID:{{userInfo.uid || 0}}</view>
				</view>
			</view>
      <!-- 商品信息 -->
      <view class="pos-order-goods split" v-if="orderInfo&&orderInfo.cartInfo[0].productInfo">
        <view class="title acea-row row-between-wrapper"
              v-if="(orderInfo.status == 0 && orderInfo.paid == 1 && orderInfo.shipping_type == 2) || orderInfo.status == 5 || (orderInfo.status == 2 && orderInfo.shipping_type == 2)">
          <text>共{{totalNmu}}件商品</text>
          <!-- <navigator class="bnt" :url="'/pages/admin/delivery/index?id='+orderInfo.order_id+'&listId='+orderInfo.id+'&totalNum='+orderInfo.total_num+'&orderStatus='+orderInfo.status+'&comeType=2'">去发货</navigator> -->
<!--          <navigator class="btn" :url="'/pages/admin/writeRecordList/index?id='+orderInfo.id" hover-class="none">-->
<!--            核销记录<text class="iconfont icon-ic_rightarrow"></text>-->
<!--          </navigator>-->
        </view>
        <view class="goods acea-row">
          <view class="picTxt acea-row">
            <view class="pictrue">
              <image :src="orderInfo.cartInfo[0].productInfo.image" />
            </view>
            <view class="text">
              <view class="info line1">{{ orderInfo.cartInfo[0].productInfo.store_name }}</view>
              <view class="attr line1">{{ orderInfo.cartInfo[0].productInfo.attrInfo.suk_alias }}</view>
            </view>
          </view>
          <view class="money">
            <!-- <view class="x-money">￥{{ item.productInfo.attrInfo?item.productInfo.attrInfo.price:item.productInfo.price }}</view> -->
<!--            <BaseMoney :money="item.productInfo.attrInfo?item.productInfo.attrInfo.price:item.productInfo.price" symbolSize="20" integerSize="32" decimalSize="20"></BaseMoney>-->
            <view class="num">共1件</view>
            <view class="acea-row row-right">
<!--              <view class="writeOff" v-if="item.refund_num  && orderInfo.refund_type != 6">{{item.refund_num}}件退款中</view>-->
<!--              <view class="writeOff" v-if="orderInfo._status==2 && orderInfo.delivery_type == 'send'">-->
<!--                <text v-if="item.refund_num">，</text>-->
<!--                <text class="on" v-if="item.is_writeoff">已核销</text>-->
<!--                <text v-if="!item.is_writeoff && item.surplus_num<item.cart_num">已核销{{parseInt(item.cart_num)-parseInt(item.surplus_num)}}件</text>-->
<!--                <text v-if="!item.is_writeoff && item.surplus_num==item.cart_num">未核销</text>-->
<!--              </view>-->
            </view>
          </view>
        </view>
<!--        <view class="giveGoods">-->
<!--          <view class="item acea-row row-between-wrapper" v-for="(item,index) in giveCartInfo" :key="index">-->
<!--            <view class="picTxt acea-row row-middle">-->
<!--              <view class="pictrue">-->
<!--                <image :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo"></image>-->
<!--                <image :src="item.productInfo.image" v-else></image>-->
<!--              </view>-->
<!--              <view class="texts">-->
<!--                <view class="name line1">[赠品]{{item.productInfo.store_name}}</view>-->
<!--                <view class="limit line1" v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}</view>-->
<!--              </view>-->
<!--            </view>-->
<!--            <view class="num">x{{item.cart_num}}</view>-->
<!--          </view>-->
<!--          <view class="item acea-row row-between-wrapper" v-for="(item,index) in giveData.give_coupon" :key="index" v-if="giveData.give_coupon.length">-->
<!--            <view class="picTxt acea-row row-middle">-->
<!--              <view class="pictrue acea-row row-center-wrapper">-->
<!--                <text class="iconfont icon-pc-youhuiquan"></text>-->
<!--              </view>-->
<!--              <view class="texts">-->
<!--                <view class="line1">[赠品]{{item.coupon_title}}</view>-->
<!--              </view>-->
<!--            </view>-->
<!--          </view>-->
<!--          <view class="item acea-row row-between-wrapper" v-if="giveData.give_integral>0">-->
<!--            <view class="picTxt acea-row row-middle">-->
<!--              <view class="pictrue acea-row row-center-wrapper">-->
<!--                <text class="iconfont icon-pc-jifen"></text>-->
<!--              </view>-->
<!--              <view class="texts">-->
<!--                <view class="line1">[赠品]{{giveData.give_integral}}里程币</view>-->
<!--              </view>-->
<!--            </view>-->
<!--          </view>-->
<!--        </view>-->
<!--        <view class="mark acea-row" v-if="orderInfo.mark">-->
<!--          <view class="name">留言</view>-->
<!--          <view class="value line1">{{orderInfo.mark}}</view>-->
<!--        </view>-->
<!--       修改规格-->
        <view class="edit-box"  v-if="showBtn('goodsInfo',orderInfo)">
          <view class="btn cancel " @click="showModel('goodsInfoShow')">修改</view>
        </view>
      </view>
<!--      订单信息-->
      <view class="wrapper order-wrapper">
        <view class="item acea-row row-between">
          <view>订单编号</view>
          <view class="conter acea-row row-middle row-right">
            {{ orderInfo.order_id
            }}
            <!-- #ifdef H5 -->
            <text class="copy copy-data" :data-clipboard-text="orderInfo.order_id">复制</text>
            <!-- #endif -->
            <!-- #ifdef MP -->
            <text class="copy copy-data" @click="copyNum(orderInfo.order_id)">复制</text>
            <!-- #endif -->
          </view>
        </view>
        <view class="item acea-row row-between">
          <view>下单时间</view>
          <view class="conter">{{ formatTime(orderInfo.add_time) }}</view>
        </view>
        <view class="item acea-row row-between">
          <view>基础资料</view>
          <view class="tag success" v-if="orderInfo.lease_user && orderInfo.lease_user.certify_status===1 && orderInfo.lease_user.contacts_info && orderInfo.lease_user.email">完成</view>
          <view class="tag error" v-else>未完成</view>
        </view>
        <view class="item acea-row row-between">
          <view>人脸核验</view>
          <view class="tag success" v-if="orderInfo.order_lease.face_auth_status===2">完成</view>
          <view class="tag error" v-else>未完成</view>
        </view>
        <view class="item acea-row row-between">
          <view>合同</view>
          <view class="tag error" v-if="orderInfo.order_lease.contract_status===-1">未生成</view>
          <view class="tag error" v-else-if="orderInfo.order_lease.contract_status===0">待签约</view>
          <view class="tag error" v-else-if="orderInfo.order_lease.contract_status===1">用户未签</view>
          <view class="tag success" v-else-if="orderInfo.order_lease.contract_status===2">
            已完成
            <span v-if="orderInfo.order_lease.check_type===1">(e签宝)</span>
            <span v-if="orderInfo.order_lease.check_type===2">(租赁宝)</span>
          </view>
          <view class="tag default" v-else-if="orderInfo.order_lease.contract_status===3">已取消</view>
        </view>
      </view>
      <!-- 金额-->
      <view class="wrapper" v-if="orderInfo.order_lease">
        <view class="item acea-row row-between">
          <view>首期租金</view>
          <view class="conter acea-row row-middle row-right">
            ￥{{orderInfo.order_lease.first_rent}}
          </view>
        </view>
        <view class="item acea-row row-between">
          <view>月租金</view>
          <view class="conter acea-row row-middle row-right">
            ￥{{ orderInfo.order_lease.per_price || '-'}}
          </view>
        </view>
        <view class="item acea-row row-between">
          <view>总租金</view>
          <view class="conter acea-row row-middle row-right" v-if="orderInfo.cartInfo">
            ￥{{orderInfo.cartInfo[0].productInfo.attrInfo.price}}
          </view>
        </view>
        <view class="item acea-row row-between">
          <view>押金</view>
          <view class="conter acea-row row-middle row-right">
            ￥{{orderInfo.order_lease.deposit}}
          </view>
        </view>
        <view class="item acea-row row-between">
          <view>买断尾款</view>
          <view class="conter acea-row row-middle row-right">
            ￥{{orderInfo.order_lease.buyout_money}}
          </view>
        </view>
        <view class="item acea-row row-between">
          <view>成本价</view>
          <view class="conter acea-row row-middle row-right">
            ￥{{orderInfo.cost}}
          </view>
        </view>
        <view class="edit-box" v-if="showBtn('money',orderInfo)">
          <view class="btn" @click="showModel('moneyShow')">编辑</view>
        </view>
      </view>
<!--      租期详情-->
      <view class="wrapper zu-box" v-if="orderInfo.order_lease">
        <view class="title">租期详情</view>
        <view v-if="!orderInfo.order_lease.start_time" class="confirm-box">
          <view class="btn" @click="generateInstallment(orderInfo)">
            生成分期账单
          </view>
        </view>
        <view v-else class="time-box">
          <view >首期：{{orderInfo.order_lease.start_time}}</view>
          <view>尾期：{{orderInfo.order_lease.end_time}}</view>
          <view class="green">
            已付{{ orderInfo.order_lease.lease_num_paid }}期/总{{ orderInfo.order_lease.lease_num }}期
          </view>
          <view class="red">
            逾期中：{{orderInfo.order_lease.dueNum}}期
          </view>
        </view>

      </view>
<!--      认证信息-->
      <view class="wrapper info-box">
        <view class="title">
          认证信息
        </view>
        <view class="main" v-if="orderInfo.lease_user">
          <view class="item">
            <view>{{ orderInfo.lease_user.real_name || '' }} ({{ orderInfo.lease_user.card_id || '' }})</view>
            <view class="white-nowrap" v-if="orderInfo.lease_user.auth">{{ JSON.parse(orderInfo.lease_user.auth).gender || '' }} ( {{calculateAge(orderInfo.lease_user.auth)}}) </view>
          </view>
          <view class="item border">
            <view class="white-nowrap">手机号码：</view>
            <view>{{ orderInfo.lease_user.phone }}</view>
          </view>
          <view class="item">
            <view>邮箱： </view>
            <view>{{ orderInfo.lease_user.email || '-'}}</view>
          </view>
          <view class="item">
            <view>最后登录时间：</view>
            <view>{{ formatTime(orderInfo.lease_user.last_time) }}</view>
          </view>
          <view class="item">
            <view class="white-nowrap">最后登录地址：</view>
            <view>{{orderInfo.lease_user.last_address || '-'}}</view>
          </view>
          <view class="item">
            <view>下单机型：</view>
            <view>{{orderInfo.current_phone_model || '-'}}</view>
          </view>
          <view class="item">
            <view class="white-nowrap">租用IMEI/SN：</view>
            <view>{{orderInfo.order_lease.serial_number || '-'}}</view>
          </view>
        </view>
      </view>
<!--      备注,记录-->
      <view class="wrapper info-box">
        <view>
          <view class="item">
            <view>平台备注：</view>
            <view class="r">
              <view>{{orderInfo.remark || '-'}}</view>
              <view class="btn" @click="modify('1')">编辑</view>
            </view>
          </view>
          <view class="item">
            <view>门店备注：</view>
            <view class="r">
              <view>-</view>
            </view>
          </view>
          <view class="item border">
            <view>用户留言：</view>
            <view class="r">
              <view>{{orderInfo.mark || '-'}}</view>
            </view>
          </view>
          <view class="item">
            <view>催收记录：</view>
            <view class="r">
              <view>{{orderInfo.connection?orderInfo.connection.content:'-'}}</view>
              <view class="btn" @click="showModel('collectionShow')">编辑</view>
            </view>
          </view>
          <view class="item">
            <view>订单日志：</view>
            <view class="r">
              <view class="btn" @click="showModel('orderLogShow')">查看</view>
            </view>
          </view>
          <view class="item">
            <view>查看物流：</view>
            <view class="r">
              <view>{{orderInfo.delivery_name}}</view>
              <span v-if="orderInfo.shipping_type===2">门店自提</span>
              <span v-if="orderInfo.shipping_type===1 && orderInfo.plat_name=='门店'">门店配送</span>
            </view>
          </view>
        </view>
      </view>

			<!-- 拆单时 -->
			<view v-for="(j, indexw) in orderInfo.split" :key="indexw" v-if="orderInfo.split && orderInfo.split.length">
				<view class="splitTitle acea-row row-between-wrapper">
					<view>订单包裹{{indexw + 1}}</view>
					<view class="title">{{j._status._title}}</view>
				</view>
				<view class="pos-order-goods">
					<navigator :url="`/pages/admin/orderDetail/index?id=${j.order_id}`" hover-class="none" class="goods acea-row row-between-wrapper" v-for="(item, index) in j.cartInfo" :key="index">
						<view class="picTxt acea-row row-between-wrapper">
							<view class="pictrue">
								<image :src="item.productInfo.attrInfo?item.productInfo.attrInfo.image:item.productInfo.image" />
							</view>
							<view class="text acea-row row-between row-column">
								<view class="info line2">
									{{ item.productInfo.store_name }}
								</view>
								<view class="attr">{{ item.productInfo.attrInfo.suk }}</view>
							</view>
						</view>
						<view class="money">
							<view class="x-money">￥{{ item.productInfo.attrInfo?item.productInfo.attrInfo.price:item.productInfo.price }}</view>
							<view class="num">x {{ item.cart_num }}</view>
							<!-- <view class="y-money">￥{{ item.productInfo.ot_price }}</view> -->
						</view>
					</navigator>
				</view>
			</view>
			<!-- 结束 -->

			<!-- <view class="public-total" v-if="!orderInfo.split || !orderInfo.split.length">
				共{{ orderInfo.total_num }}件商品，实付款
				<span class="money">￥{{ orderInfo.pay_price }}</span> ( 邮费 ¥{{
		    orderInfo.pay_postage
		  }}
				)
			</view> -->
			<!-- 结束 -->
			<view class="wrapper" v-if="orderInfo.type == 10">
				<view class="item acea-row row-between">
					<view>桌台号</view>
					<view class='conter'>{{orderInfo.table_info.category.name+' ('+orderInfo.table_info.table_number+'号)'}}</view>
				</view>
				<view class="item acea-row row-between">
					<view>就餐人数</view>
					<view class='conter'>{{orderInfo.table_info.number_diners}}</view>
				</view>
			</view>
			<view class='wrapper' v-if='orderInfo.delivery_type=="fictitious" && orderInfo.product_type!=1'>
				<view class='item acea-row row-between' v-if="orderInfo.fictitious_content">
					<view>虚拟备注</view>
					<view class='conter'>{{orderInfo.fictitious_content}}</view>
				</view>
			</view>
			<view class='wrapper' v-if="orderInfo.virtual_info && orderInfo.product_type==1">
				<view class="title">卡密发货</view>
				<view v-for="(item,index) in orderInfo.virtual_info" :key="index" v-if="Array.isArray(orderInfo.virtual_info)">
					<view class='item acea-row row-between'>
						<view>卡号</view>
						<view class='conter'>{{item.card_no}}</view>
					</view>
					<view class='item acea-row row-between'>
						<view>密码</view>
						<view class='conter'>{{item.card_pwd}}</view>
					</view>
				</view>
				<view class="mt-16 bg--w111-f5f5f5 text--w111-999 rd-16rpx p-24 lh-36rpx">{{orderInfo.virtual_info}}</view>
			</view>
			<customForm :customForm="orderInfo.custom_form" class="customForm"></customForm>
			<view class="wrapper" v-if="
		    orderInfo.delivery_type != 'fictitious' && orderInfo._status === 2 && (!orderInfo.split || !orderInfo.split.length)
		  ">
				<view class="item acea-row row-between">
					<view>配送方式</view>
					<view class="conter" v-if="orderInfo.delivery_type === 'express'">
						快递
					</view>
					<view class="conter" v-if="orderInfo.delivery_type === 'send'">送货</view>
				</view>
				<view class="item acea-row row-between">
					<view v-if="orderInfo.delivery_type === 'express'">快递公司</view>
					<view v-if="orderInfo.delivery_type === 'send'">送货人</view>
					<view class="conter">{{ orderInfo.delivery_name }}</view>
				</view>
				<view class="item acea-row row-between">
					<view v-if="orderInfo.delivery_type === 'express'">快递单号</view>
					<view v-if="orderInfo.delivery_type === 'send'">送货人电话</view>
					<view class="conter">
						{{ orderInfo.delivery_id}}
						<!-- #ifdef H5 -->
						<span class="copy copy-data" :data-clipboard-text="orderInfo.delivery_id">复制</span>
						<!-- #endif -->
						<!-- #ifdef MP -->
						<span class="copy copy-data" @click="copyNum(orderInfo.delivery_id)">复制</span>
						<!-- #endif -->
					</view>
				</view>
			</view>
			<view class="wrapper">
<!--				<view class='item acea-row row-between'>-->
<!--					<view>商品总价</view>-->
<!--					<view class='conter' v-if="statusType == -3">-->
<!--						￥{{orderInfo.total_price}}</view>-->
<!--					<view class='conter' v-else>-->
<!--						￥{{(parseFloat(orderInfo.total_price)+parseFloat(orderInfo.vip_true_price)).toFixed(2)}}</view>-->
<!--				</view>-->
				<view class="item acea-row row-between" v-if="orderInfo.pay_postage > 0">
					<view>配送运费</view>
					<view class="conter">￥{{ orderInfo.pay_postage }}</view>
				</view>
				<view v-if="orderInfo.vip_true_price > 0" class='item acea-row row-between'>
					<view>会员商品优惠</view>
					<view class='conter'>-￥{{parseFloat(orderInfo.vip_true_price).toFixed(2)}}</view>
				</view>
				<view class="item acea-row row-between" v-if='orderInfo.coupon_id'>
					<view>优惠券抵扣</view>
					<view class="conter">-￥{{ orderInfo.coupon_price }}</view>
				</view>
				<view class='item acea-row row-between' v-if="orderInfo.use_integral > 0">
					<view>里程币抵扣</view>
					<view class='conter'>-￥{{parseFloat(orderInfo.deduction_price).toFixed(2)}}</view>
				</view>
				<view class='item acea-row row-between' v-for="(item,index) in orderInfo.promotions_detail" :key="index" v-if="parseFloat(item.promotions_price)">
					<view>{{item.title}}</view>
					<view class='conter'>-￥{{parseFloat(item.promotions_price).toFixed(2)}}</view>
				</view>
<!--				<view class="actualPay acea-row row-right">-->
<!--					实付款：-->
<!--					&lt;!&ndash; <span class="money">￥{{ orderInfo.pay_price }}</span> &ndash;&gt;-->
<!--					<BaseMoney :money="orderInfo.pay_price" symbolSize="24" integerSize="40" decimalSize="24" color="#FF7E00"></BaseMoney>-->
<!--				</view>-->
			</view>
<!--      备注-->
<!--      <view class="remarks acea-row row-middle mt-20" v-if="goname != 'looks'">-->
<!--        <text class="iconfont icon-ic_notes mr-10"></text>备注：-->
<!--        <input class="line1" style="text-align: left;" :value="-->
<!--		      orderInfo.remark ? orderInfo.remark : '订单未备注，点击添加备注信息'-->
<!--		    " disabled @click="modify('1')" />-->
<!--      </view>-->

<!--      监管锁-->
      <view class="wrapper mdm-box" v-if="false">
        <view class="title">监管锁</view>
        <view class="main">
          <view class="mdm-item" v-for="(e,i) in orderInfo.mdm_status">
            <view v-if="['删除监管', '删除激活锁'].indexOf(e.remark) > -1" class="btn-color red">
              {{ e.remark }}
            </view>
            <view v-else-if="['获取设备信息', '查询设备操作日志', '查看已安装app'].indexOf(e.remark) > -1"
                  class="btn-color">
              {{ e.remark }}
            </view>
            <view v-else-if="['丢失设备', '解除丢失', '关闭支付模式'].indexOf(e.remark) > -1" class="btn-color origin">
              {{ e.remark }}
            </view>
            <view v-else-if="e.remark === '开启支付模式'" class="btn-color origin">
              {{ e.remark }}
            </view>
            <view v-else class="btn-color origin">
              {{ e.remark }}
            </view>
          </view>
        </view>
      </view>


			<view class="height-add"></view>
			<view class="footer acea-row row-right row-middle" v-if="goname != 'looks'">
        <scroll-view class="scroll-view" scroll-x="true" >
          <view class="btn-color origin" @click="goRisk(orderInfo)">
            风控查询
          </view>
          <view v-if="leaseStatus[orderInfo._status]==='no_verify'" class="btn-color" @click="showModel('verifyOrderShow')">
            审核订单
          </view>
          <view v-if="['no_zhima', 'no_contract'].indexOf(leaseStatus[orderInfo._status])>-1 && orderInfo.order_lease.check_type != 2 && orderInfo.order_lease.freeze_status == 0" class="btn-color" @click="showModel('editContractShow')">
            转租赁宝
          </view>
          <view v-if="leaseStatus[orderInfo._status]==='no_contract'" class="btn-color" @click="showModel('setSnShow')">
            生成合同
          </view>
          <view v-if="leaseStatus[orderInfo._status]==='contract'" class="btn-color" @click="startContract(orderInfo)">
            发起签署
          </view>
          <view v-if="orderInfo.order_lease.contract_status===2" class="btn-color" @click="goContract">
            查看合同
          </view>
          <view v-if="leaseStatus[orderInfo._status]==='no_delivery'" class="btn-color delivery" :class="openErp?'on':''"
                @click="goDelivery(orderInfo)">
            订单发货
          </view>
          <view v-if="orderInfo.order_lease.start_time" class="btn-color" @click="goLeaseBill(orderInfo)">
            租金账单
          </view>
<!--          <view v-if="leaseStatus[orderInfo._status]==='not_written'" class="btn-color">-->
<!--            订单核销-->
<!--          </view>-->
<!--          <view class="btn-color blue-ghost">-->
<!--            押金管理-->
<!--          </view>-->
<!--          <view class="btn-color blue-ghost">-->
<!--            逾期操作-->
<!--          </view>-->
          <view v-if="leaseStatus[orderInfo._status]==='not_written'" class="btn-color" @click="verify">订单核销</view>
          <view class="btn-color blue-ghost" @click="goLeaseUserData">
            认证资料
          </view>
          <view class="btn-color blue-ghost" @click="goLeaseData">
            补充资料
          </view>
          <view class="btn-color blue-ghost" @click="goDeposit">
            押金管理
          </view>
          <view class="btn-color blue-ghost" @click="goGongZheng">
            公证管理
          </view>
          <view v-if="leaseStatus[orderInfo._status]!='delete'" class="btn-color blue-ghost" @click="goLease">
            租赁管理
          </view>
          <view @click="showModel('cancelShow')" v-if="orderInfo.status<2 && leaseStatus[orderInfo._status]!=='delete'" class="btn-color red">
            取消订单
          </view>
<!--          <view class="btn-color cancel" :class="openErp?'on':''" @click="modify('0')" v-if="types == 0">-->
<!--            一键改价-->
<!--          </view>-->
          <!-- types == -1 -->
<!--          <view class="btn-color cancel" @click="modify('1')">订单备注</view>-->
<!--          <view class="btn-color cancel" :class="openErp?'on':''" @click="modify('2',1)"-->
<!--            v-if="(!orderInfo.refund || !orderInfo.refund.length) && (orderInfo.refund_type == 0 || orderInfo.refund_type == 1 || orderInfo.refund_type == 5) && orderInfo.paid && parseFloat(orderInfo.pay_price) >= 0">-->
<!--            立即退款-->
<!--          </view>-->
<!--          <view class="btn-color cancel" :class="openErp?'on':''" @click="modify('2',0)" v-if="orderInfo.refund_type == 2">-->
<!--            同意退货-->
<!--          </view>-->
          <!-- <view class="wait" :class="openErp?'on':''" v-if="orderInfo.refund_type == 4">待用户发货</view> -->
          <!-- <view class="btn-color cancel" :class="openErp?'on':''" v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0" @click="offlinePay">
            确认付款
          </view> -->
<!--          <view class="btn-color delivery" :class="openErp?'on':''" v-if="orderInfo.status == 0 && orderInfo.paid === 0" @click="confirmShow = true">-->
<!--            确认付款-->
<!--          </view>-->

          <view class="btn-color delivery" v-if="orderInfo.delivery_type == 'express' && orderInfo._status == 2" @click="goLogistics(orderInfo)">查看物流</view>

        </scroll-view>
			</view>
			<PriceChange :change="change" :orderInfo="orderInfo" :isRefund="isRefund" v-on:statusChange="statusChange($event)" v-on:closechange="changeclose($event)" v-on:savePrice="savePrice"
				:status="status"></PriceChange>
		</view>
		<view v-if="confirmShow" class="mask"></view>
		<view v-if="confirmShow" class="confirm-popup">
			<view class="title">确认付款</view>
			<view class="info">确认该订单用户已付款</view>
			<view class="acea-row btn-box">
				<view class="btn" @click="confirmShow = false">取消</view>
				<view class="btn primary" @click="offlinePay">确认</view>
			</view>
		</view>
<!--		<home></home>-->
    <!-- 修改规格 -->
    <view v-if="goodsInfoShow">
      <goodsInfoEditModal :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></goodsInfoEditModal>
    </view>
    <!-- 收货地址 -->
    <view v-if="addressShow">
      <addressEditModal :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></addressEditModal>
    </view>
    <!-- 修改金额 -->
    <view v-if="moneyShow">
      <moneyEditModal :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></moneyEditModal>
    </view>
    <!-- 订单审核 -->
    <view v-if="verifyOrderShow">
      <verifyOrderModal :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></verifyOrderModal>
    </view>
    <!-- 转租赁宝 -->
    <view v-if="editContractShow">
      <editContractModal :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></editContractModal>
    </view>
    <!-- 生成合同 -->
    <view v-if="setSnShow">
      <setSnModal :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></setSnModal>
    </view>
    <!-- 催收记录 -->
    <view v-if="collectionShow">
      <CollectionRecordModel :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></CollectionRecordModel>
    </view>
    <!-- 订单日志 -->
    <view v-if="orderLogShow">
      <orderLogModel :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></orderLogModel>
    </view>
    <!-- 取消订单 -->
    <view v-if="cancelShow">
      <cancelModal :nowItem="orderInfo" @refresh="getIndex" @close="closeModel"></cancelModal>
    </view>
  </view>
</template>
<script>
	import PriceChange from "../components/PriceChange/index.vue";
	import home from '../components/home/index.vue';
	import customForm from "../components/customForm";
	import countDown from '@/components/countDown/index.vue'
	// #ifdef MP || APP-PLUS
	import NavBar from "@/components/NavBar.vue";
	// #endif
	// #ifdef H5
	import ClipboardJS from "@/plugin/clipboard/clipboard.js";
	// #endif
	import {
		getStoreOrderDetail,
		getAdminOrderDetail,
		getStoreRefundDetail,
		getAdminRefundDetail,
		setStoreOrderPrice,
		setAdminOrderPrice,
		setStoreRefundRemark,
		setAdminRefundRemark,
		setStoreOrderRemark,
		setAdminOrderRemark,
		setStoreOfflinePay,
		setOfflinePay,
		setStoreOrderRefund,
		setOrderRefund,
		storeOrderRefundAgree,
		orderRefundAgree,
		getStoreUserInfo,
		getUserInfo,
	} from "@/api/admin";
	import {
		erpConfig
	} from "@/api/esp.js";
	import {
		isMoney
	} from '@/utils/validate.js'
  import {formatTime, InstallmentStatus, leaseStatus} from "../../../utils/order";
  import AddressEditModal from "../components/addressEditModal.vue";
  import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
  import MoneyEditModal from "../components/moneyEditModal.vue";
  import GoodsInfoEditModal from "../components/goodsInfoEditModal.vue";
  import VerifyOrderModal from "../components/verifyOrderModal.vue";
  import {generateInstallment, startContract} from "../../../api/admin";
  import EditContractModal from "../components/editContractModal.vue";
  import SetSnModal from "../components/setSnModal.vue";
  import CollectionRecordModel from "../components/collectionRecordModel.vue";
  import OrderLogModel from "../components/orderLogModel.vue";
  import CancelModal from "../components/cancelModal.vue";
  import {getDownLoadUrl} from "../../../api/order";

	export default {
		name: "AdminOrder",
    computed: {
      leaseStatus() {
        return leaseStatus
      }
    },
		components: {
      CancelModal,
      OrderLogModel,
      CollectionRecordModel,
      SetSnModal,
      EditContractModal,
      VerifyOrderModal,
      GoodsInfoEditModal,
      MoneyEditModal,
      UniPopup,
      AddressEditModal,
			PriceChange,
			customForm,
			countDown,
			home,
			// #ifdef MP || APP-PLUS
			NavBar,
			// #endif
		},
		props: {},
		data: function() {
			return {
        cancelShow:false,
        orderLogShow:false,
        collectionShow:false,
        addressShow:false,
        moneyShow:false,
        goodsInfoShow:false,
        verifyOrderShow:false,
        editContractShow:false,
        setSnShow:false,
				openErp: false,
				giveData: {
					give_integral: 0,
					give_coupon: []
				},
				giveCartInfo: [],
				totalNmu: 0,
				order: false,
				change: false,
				order_id: "",
				orderInfo: {
					_status: {}
				},
				status: "",
				title: "",
				payType: "",
				types: "",
				statusType: '',
				clickNum: 1,
				goname: '',
				isRefund: 0, //1是仅退款;0是同意退货退款
				iconColor: '#FFFFFF',
				isScrolling: false,
				getHeight: this.$util.getWXStatusHeight(),
				confirmShow: false,
				userInfo: {},
				storeNum:1
			};
		},
		watch: {
			"$route.params.oid": function(newVal) {
				let that = this;
				if (newVal != undefined) {
					that.order_id = newVal;
					that.getIndex();
				}
			}
		},
		onLoad: function(option) {
			this.storeNum = parseInt(option.storeNum);
			this.order_id = option.id;
			this.goname = option.goname
			this.statusType = option.types
		},
    // 下拉刷新
    onPullDownRefresh() {
      this.getIndex();
      uni.stopPullDownRefresh();
    },
		onShow() {
			let self = this
			this.getIndex();
			this.getErpConfig();
			// #ifdef H5
			this.$nextTick(function() {
				var clipboard = new ClipboardJS('.copy-data');
				// var copybtn = document.getElementsByClassName("copy-data");
				// var clipboard = new Clipboard(copybtn);
				clipboard.on('success', function(e) {
					self.$util.Tips({
						title: '复制成功'
					})
				});
				clipboard.on('error', function(e) {
					self.$util.Tips({
						title: '复制失败'
					})
				});
			});
			// #endif
		},
		onPageScroll(e) {
			// #ifdef MP || APP-PLUS
			if (e.scrollTop > 50) {
				this.iconColor = '#333333';
				this.isScrolling = true;
			} else {
				this.iconColor = '#FFFFFF';
				this.isScrolling = false;
			}
			// #endif
		},
		methods: {
      formatTime,
      goContract(){
        uni.showLoading({
          title: '加载合同中',
        })
        let id=this.orderInfo.id
        getDownLoadUrl(id).then(res=>{
          let url = this.orderInfo.order_lease.check_type===1 ? res.data.download_url : res.data.url
          uni.downloadFile({
            url: url,
            success: (res) => {
              uni.hideLoading()
              if (res.statusCode === 200) {
                uni.openDocument({
                  filePath: res.tempFilePath,
                  fileType: 'pdf',
                  fail: (err) => {
                    this.$util.Tips({ title: '合同加载失败'})
                  }
                });
              }
            },
            fail: (err) => {
              uni.hideLoading()
              this.$util.Tips({ title: '合同加载失败'})
            }
          });
        })
      },
      goRisk(row){
        uni.navigateTo({
          url: `/pages/admin/leaseRisk/index?order_id=${this.orderInfo.order_id}&statusType=${this.statusType}`
        })
      },
      closeModel(pop){
        this[pop] = false
      },
      showModel(pop){
        this[pop] = true
      },
      getCartInfo(row){
        return row.cartInfo[0]
      },
      goLeaseBill(row){
        uni.navigateTo({
          url: `/pages/admin/leaseBill/index?order_id=${this.orderInfo.order_id}&statusType=${this.statusType}`
        })
      },
      goLeaseUserData(){
        uni.navigateTo({
          url:`/pages/admin/leaseUserData/index?order_id=${this.orderInfo.order_id}&statusType=${this.statusType}`
        })
      },
      goLeaseData(){
        uni.navigateTo({
          url:`/pages/admin/leaseData/index?order_id=${this.orderInfo.order_id}&statusType=${this.statusType}`
        })
      },
      goDeposit(){
        uni.navigateTo({
          url:`/pages/admin/leaseDeposit/index?order_id=${this.orderInfo.order_id}&statusType=${this.statusType}`
        })
      },
      goGongZheng(){
        uni.navigateTo({
          url:`/pages/admin/leaseGongZheng/index?order_id=${this.orderInfo.order_id}&statusType=${this.statusType}`
        })
      },
      goLease(){
        uni.navigateTo({
          url:`/pages/admin/leaseManage/index?order_id=${this.orderInfo.order_id}&statusType=${this.statusType}`
        })
      },
      // 发起签署
      startContract(row){
        // 加载提示
        uni.showLoading({
          title: '发起签署中',
        })
        startContract(row.id).then(res=>{
          if(res.status===200){
            uni.hideLoading()
            this.$util.Tips({
              title:'发起签署成功'
            })
            this.getIndex()
          }
        })
      },
      // 生成分期账单
      generateInstallment(row){
        uni.showLoading({
          title: '生成分期账单中',
        })
        generateInstallment(row.id).then(res=>{
          uni.hideLoading()
          if(res.status===200){
            this.$util.Tips({
              title:'生成分期账单成功'
            })
            this.getIndex()
          }
        })
      },
      // 按钮显示
      showBtn(btn,row){
        if(btn==='goodsInfo'||btn==='money'){
          if(!row.order_lease.start_time) {
            return true
          }else{
            return false
          }
        }
        if(btn==='address'){
          return row.delivery_id.length>0?false:true
        }
      },
      // 逾期数量
      getOverdueNum(row){
        let num = 0
        row.order_installment.forEach(item=>{
          // 已逾期
          if(InstallmentStatus[item.status]==='paid_overdue'){
            num++
          }
        })
        return num
      },
      calculateAge(auth) {
        let birthday=JSON.parse(auth).birthDay
        var today = new Date();
        var birthDate = new Date(birthday);

        var age = today.getFullYear() - birthDate.getFullYear();
        var monthDiff = today.getMonth() - birthDate.getMonth();

        // 如果当前月份小于出生月份，或者当前月份等于出生月份但当前日期小于出生日期，则年龄减一
        if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {
          age--;
        }


        return age;
      },
			verify() {
				if (this.orderInfo.product_type == 4) {
					uni.navigateTo({
						url: '/pages/admin/writeOffCard/index?id=' + this.orderInfo.id
					})
				} else {
					uni.navigateTo({
						url: '/pages/admin/distribution/scanning/detail/index?auth=1&id=' + this.orderInfo.id + '&let=1&code=' + this.orderInfo.verify_code
					})
				}
			},
			statusChange(e) {
				this.status = e;
			},
			goLogistics(orderInfo) {
				uni.navigateTo({
					url: '/pages/admin/logistics/index?orderId=' + orderInfo.order_id
				})
			},
			goDelivery(orderInfo) {
				if (this.openErp) return
				uni.navigateTo({
					url: '/pages/admin/delivery/index?id=' + orderInfo.order_id + '&listId=' + orderInfo.id + '&totalNum=' + orderInfo.total_num + '&orderStatus=' + orderInfo.status +
						'&comeType=2&productType=' + orderInfo.product_type
				})
			},
			getErpConfig() {
				erpConfig().then(res => {
					this.openErp = res.data.open_erp;
				}).catch(err => {
					this.$util.Tips({
						title: err
					})
				})
			},
			getpreviewImage: function(index, num) {
				uni.previewImage({
					urls: num ? this.orderInfo.refund_img : this.orderInfo.refund_goods_img,
					current: num ? this.orderInfo.refund_img[index] : this.orderInfo.refund_goods_img[index]
				});
			},
			more: function() {
				this.order = !this.order;
			},
			modify: function(status, type) {
				if (status != 1 && this.openErp) return


				if (status == 2) {
					this.isRefund = type
					uni.navigateTo({
						url: '/pages/admin/refund/index?id=' + this.orderInfo.order_id + '&listId=' + this.orderInfo.id
					})
				} else {
					this.change = true;
					this.status = status;
				}
			},
			changeclose: function(msg) {
				this.change = msg;
			},
			getIndex: function() {
				let that = this;
				let obj = '';
				if (that.statusType == -3) {
					let funApi = '';
					if(this.storeNum){
						funApi = getAdminRefundDetail(that.order_id);
					}else{
						funApi = getStoreRefundDetail(that.order_id);
					}
					obj = funApi;
				} else {
					let funApi = '';
					if(this.storeNum){
						funApi = getAdminOrderDetail(that.order_id);
					}else{
						funApi = getStoreOrderDetail(that.order_id);
					}
					obj = funApi;
				}
        uni.showLoading({
          title: '加载中',
        })
				obj.then(res => {
          uni.hideLoading()
					let num = 0;
					that.types = res.data._status._type;
					that.title = res.data._status._title;
					that.payType = res.data._status._payType;
					that.giveData.give_coupon = res.data.give_coupon;
					that.giveData.give_integral = res.data.give_integral;
					let cartObj = [],
						giftObj = [];
					res.data.cartInfo.forEach((item, index) => {
						num += item.cart_num
						if (item.is_gift == 1) {
							giftObj.push(item)
						} else {
							cartObj.push(item)
						}
					});
					this.totalNmu = num;
					res.data.cartInfo = cartObj;
					that.$set(that, 'giveCartInfo', giftObj);
					that.orderInfo = res.data;
					that.getUserInfo();
          if(this.orderInfo.order_lease.start_time){
            this.orderInfo.order_lease.start_time=formatTime(this.orderInfo.order_lease.start_time)
            this.orderInfo.order_lease.end_time=formatTime(this.orderInfo.order_lease.end_time)
            this.orderInfo.order_lease.dueNum=this.getOverdueNum(this.orderInfo)
          }
				}).catch(err => {
					return that.$util.Tips({
						title: err.msg
					});
				})
			},
			objOrderRefund(data) {
				let that = this;
				let funApi = '';
				if(this.storeNum){
					funApi = setOrderRefund;
				}else{
					funApi = setStoreOrderRefund;
				}
				funApi(data).then(
					res => {
						that.change = false;
						that.$util.Tips({
							title: res.msg
						});
						that.getIndex();
					},
					err => {
						that.change = false;
						that.$util.Tips({
							title: err
						});
					}
				);
			},
			async savePrice(opt) {
				let that = this,
					data = {},
					price = opt.price,
					refund_price = opt.refund_price,
					refund_status = that.orderInfo.refund_status,
					remark = opt.remark;
				data.order_id = that.orderInfo.order_id;
				if (that.status == 0) {
					if (!isMoney(price)) {
						return that.$util.Tips({
							title: '请输入正确的金额'
						});
					}
					data.price = price;
					let funApi = '';
					if(this.storeNum){
						funApi = setAdminOrderPrice;
					}else{
						funApi = setStoreOrderPrice;
					}
					funApi(data).then(
						function() {
							that.change = false;
							that.$util.Tips({
								title: '改价成功',
								icon: 'success'
							})
							that.getIndex();
						},
						function() {
							that.change = false;
							that.$util.Tips({
								title: '改价失败',
								icon: 'none'
							})
						}
					);
				} else if (that.status == 2) {
					if (this.isRefund) {
						if (!isMoney(refund_price)) {
							return that.$util.Tips({
								title: '请输入正确的金额'
							});
						}
						data.price = refund_price;
						data.type = opt.type;
						this.objOrderRefund(data);
					} else {
						if (opt.type == 1) {
							let funApi = '';
							if(this.storeNum){
								funApi = orderRefundAgree;
							}else{
								funApi = storeOrderRefundAgree;
							}
							funApi(this.orderInfo.id).then(res => {
								that.change = false;
								that.$util.Tips({
									title: res.msg
								});
								that.getIndex();
							}).catch(err => {
								that.change = false;
								that.$util.Tips({
									title: err
								});
							})
						}
					}
				} else if (that.status == 8) {
					data.type = opt.type;
					data.refuse_reason = opt.refuse_reason;
					this.objOrderRefund(data);
				} else {
					if (!remark) {
						return this.$util.Tips({
							title: '请输入备注'
						})
					}
					data.remark = remark;
					let obj = '';
					if (that.statusType == -3) {
						let funApi = '';
						if(this.storeNum){
							funApi = setAdminRefundRemark(data);
						}else{
							funApi = setStoreRefundRemark(data);
						}
						obj = funApi;
					} else {
						let funApi = '';
						if(this.storeNum){
							funApi = setAdminOrderRemark(data);
						}else{
							funApi = setStoreOrderRemark(data);
						}
						obj = funApi;
					}
					obj.then(
						res => {
							that.change = false;
							this.$util.Tips({
								title: res.msg,
								icon: 'success'
							})
							this.orderInfo.remark = remark;
							// that.getIndex();
						},
						err => {
							that.change = false;
							that.$util.Tips({
								title: err
							});
						}
					);
				}
			},
			offlinePay: function() {
				if (this.openErp) return
				let funApi = '';
				if(this.storeNum){
					funApi = setOfflinePay;
				}else{
					funApi = setStoreOfflinePay;
				}
				funApi({
					order_id: this.orderInfo.order_id
				}).then(
					res => {
						this.confirmShow = false;
						this.$util.Tips({
							title: res.msg,
							icon: 'success'
						});
						this.getIndex();
					},
					err => {
						this.$util.Tips({
							title: err
						});
					}
				);
			},
			// #ifdef MP
			copyNum(id) {

				uni.setClipboardData({
					data: id,
					success: function() {
            uni.showToast({
              title: '复制成功'
            })
          }
				});
			},
			// #endif
			// #ifdef H5
			webCopy(item, index) {
				let items = item
				let indexs = index
				let self = this

				if (self.clickNum == 1) {
					self.clickNum += 1
					self.webCopy(items, indexs)
				}
			},
			// #endif
			getUserInfo() {
				let funApi = '';
				if(this.storeNum){
					funApi = getUserInfo;
				}else{
					funApi = getStoreUserInfo;
				}
				funApi(this.orderInfo.uid).then(res => {
					this.userInfo = res.data;
				});
			},
		}
	};
</script>

<style lang="scss" scoped>
	.headerBg {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		background-image: linear-gradient(360deg, #F5F5F5 0%, rgba(245, 245, 245, 0) 100%),
			linear-gradient(270deg, #01ABF8 0%, #2A7EFB 100%);
		background-position: left bottom, left top;
		background-repeat: no-repeat;
		background-size: 100% 120rpx, 100% 100%;

		.inner {
			height: 356rpx;
		}
	}

	.order-details {
		position: absolute;
		width: 100%;
		padding: 0 20rpx;
	}

	.height-add {
		height: calc(120rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		height: calc(120rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
	}

	.giveGoods {
		.item {
			padding: 14rpx 30rpx 14rpx 0;
			margin-left: 30rpx;
			border-top: 1px solid #eee;

			.picTxt {
				.pictrue {
					width: 76rpx;
					height: 76rpx;
					border-radius: 6rpx;
					background-color: #F5F5F5;
					color: #2a7efb;

					.iconfont {
						font-size: 34rpx;
					}

					image {
						width: 100%;
						height: 100%;
						border-radius: 6rpx;
					}

					margin-right: 16rpx;
				}

				.texts {
					width: 360rpx;
					color: #999999;
					font-size: 20rpx;

					.name {
						color: #333;
					}

					.limit {
						font-size: 20rpx;
						margin-top: 4rpx;
					}
				}
			}

			.num {
				color: #999999;
				font-size: 20rpx;
			}
		}
	}

	.splitTitle {
		width: 100%;
		height: 80rpx;
		background-color: #fff;
		margin-top: 17rpx;
		border-bottom: 1px solid #e5e5e5;
		padding: 0 30rpx;
	}

	.splitTitle .title {
		color: #2291f8;
	}

	/*商户管理订单详情*/
	.pos-order-details .header {
		// background: linear-gradient(270deg, #1cd1dc 0%, #2291f8 100%);
	}

	.pos-order-details .header .state {}

	.pos-order-details .header .data {}

	.pos-order-details .header .data .order-num {
		font-size: 26upx;
		margin-bottom: 8upx;
	}

	.pos-order-details .remarks {
		padding-left: 32rpx;
		border-radius: 24rpx;
		background: #FFFFFF;
	}

	.pos-order-details .remarks .iconfont {
		font-size: 32rpx;
		color: #000000;
	}

	.pos-order-details .remarks input {
		flex: 1;
		height: 100rpx;
		padding-left: 20rpx;
		font-size: 28rpx;
	}

	.pos-order-details .remarks input::placeholder {
		color: #CCCCCC;
	}

	.pos-order-details .orderingUser {
		font-size: 26upx;
		color: #282828;
		padding: 0 30upx;
		height: 67upx;
		background-color: #fff;
		margin-top: 16upx;
		border-bottom: 1px solid #f5f5f5;
	}

	.pos-order-details .orderingUser .iconfont {
		font-size: 40upx;
		color: #2a7efb;
		margin-right: 15upx;
	}

	.pos-order-details .address {
		margin-top: 0;
	}

	.pos-order-details .footer .more {
		font-size: 27upx;
		color: #aaa;
		width: 100upx;
		height: 64upx;
		text-align: center;
		line-height: 64upx;
		margin-right: 25upx;
		position: relative;
	}

	.pos-order-details .footer .delivery {
		border-color: #2A7EFB !important;
		background: #2A7EFB;
		color: #FFFFFF !important;
	}

	.pos-order-details .footer .more .order .arrow {
		width: 0;
		height: 0;
		border-left: 11upx solid transparent;
		border-right: 11upx solid transparent;
		border-top: 20upx solid #e5e5e5;
		position: absolute;
		left: 15upx;
		bottom: -18upx;
	}

	.pos-order-details .footer .more .order .arrow:before {
		content: '';
		width: 0;
		height: 0;
		border-left: 9upx solid transparent;
		border-right: 9upx solid transparent;
		border-top: 19upx solid #fff;
		position: absolute;
		left: -10upx;
		bottom: 0;
	}

	.pos-order-details .footer .more .order {
		width: 200upx;
		background-color: #fff;
		border: 1px solid #eee;
		border-radius: 10upx;
		position: absolute;
		top: -200upx;
		z-index: 9;
	}

	.pos-order-details .footer .more .order .item {
		height: 77upx;
		line-height: 77upx;
	}

	.pos-order-details .footer .more .order .item~.item {
		border-top: 1px solid #f5f5f5;
	}

	.pos-order-details .footer .more .moreName {
		width: 100%;
		height: 100%;
	}

	/*订单详情*/
	.order-details .header {
		padding: 48rpx 0 30rpx 12rpx;
	}

	.order-details .header.on {
		background-color: #666 !important;
	}

	.order-details .header .pictrue {
		width: 110upx;
		height: 110upx;
	}

	.order-details .header .pictrue image {
		width: 100%;
		height: 100%;
	}

	.order-details .header .state {
		font-weight: 500;
		font-size: 36rpx;
		line-height: 50rpx;
		color: #FFFFFF;
	}

	.order-details .header .data {
		margin-top: 8rpx;
		font-size: 26rpx;
		line-height: 36rpx;
		color: #FFFFFF;
	}

	.order-details .header.on .data {
		margin-left: 0;
	}

	.order-details .header .data .time {
		margin-left: 20rpx;
	}

	.order-details .header .data .state {
		font-size: 30upx;
		font-weight: bold;
		color: #fff;
		margin-bottom: 7upx;
	}

	/* .order-details .header .data .time{margin-left:20upx;} */
	.order-details .nav {
		background-color: #fff;
		font-size: 26upx;
		color: #282828;
		padding: 25upx 0;
	}

	.order-details .nav .navCon {
		padding: 0 40upx;
	}

	.order-details .nav .navCon .on {
		font-weight: bold;
		color: #e93323;
	}

	.order-details .nav .progress {
		padding: 0 65upx;
		margin-top: 10upx;
	}

	.order-details .nav .progress .line {
		width: 100upx;
		height: 2upx;
		background-color: #939390;
	}

	.order-details .nav .progress .iconfont {
		font-size: 25upx;
		color: #939390;
		margin-top: -2upx;
		width: 30upx;
		height: 30upx;
		line-height: 33upx;
		text-align: center;
		margin-right: 0 !important;
	}

	.order-details .address {
		position: relative;
		padding: 32rpx 32rpx 40rpx;
		border-radius: 24rpx;
		margin-top: 20rpx;
		background: #FFFFFF;
		overflow: hidden;
		font-size: 24rpx;
		line-height: 34rpx;
		color: #999999;
	}

	.order-details .address .name {
		margin-bottom: 12rpx;
		font-weight: 500;
		font-size: 30rpx;
		line-height: 42rpx;
		color: #333333;
	}

	.order-details .address .name .iconfont {
		margin-right: 8rpx;
		font-size: 32rpx;
	}

	.order-details .address .name .phone {
		margin-left: 40upx;
	}

	.order-details .line {
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 4rpx;
	}

	.order-details .line image {
		width: 100%;
		height: 100%;
		display: block;
	}

	.order-details .wrapper {
		padding: 32rpx 24rpx;
		border-radius: 24rpx;
		margin-top: 20rpx;
		background: #FFFFFF;
	}
	
	.order-details .wrapper .title{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 28rpx;
		color: #3D3D3D;
		margin-bottom: 32rpx;
	}

	.order-details .wrapper .item {
		font-size: 28rpx;
		line-height: 40rpx;
		color: #333333;
	}

	.order-details .wrapper .item~.item {
		margin-top: 24rpx;
	}

	.order-details .wrapper .item .conter {
		// color: #868686;
		// width: 468rpx;
		// display: flex;
		// flex-wrap: nowrap;
		// justify-content: flex-end;
		// text-align: right;

		.pictrue {
			width: 80rpx;
			height: 80rpx;
			margin-left: 6rpx;

			image {
				width: 100%;
				height: 100%;
				border-radius: 6rpx;
			}
		}
	}

	.order-details .wrapper .item .conter .copy {
		height: 36rpx;
		padding: 0 12rpx;
		border: 0;
		border-radius: 18rpx;
		margin-left: 8rpx;
		background: #F5F5F5;
		font-size: 22rpx;
		line-height: 36rpx;
		color: #333333;
	}

	.order-details .wrapper .actualPay {
		margin-top: 26rpx;
	}

	.order-details .wrapper .actualPay .money {
		font-weight: bold;
		font-size: 30upx;
		color: #e93323;
	}

	.order-details .footer {
		width: 100%;
		height: 100upx;
		position: fixed;
		bottom: 0;
		left: 0;
		background-color: #fff;
		padding: 0 30upx;
		border-top: 1px solid #eee;
		height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		padding-bottom: calc(0rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		padding-bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
	}

	.order-details .footer .wait {
		color: #2a7efb;
		margin-right: 30rpx;
	}

	.order-details .footer .bnt {

	}

	.order-details .footer .bnt.cancel {
		// color: #333333;
		// border: 1px solid #CCCCCC;
	}

	.order-details .footer .bnt.default {
		color: #444;
		border: 1px solid #444;
	}

	.order-details .footer .bnt~.bnt {
		margin-left: 16rpx;
	}

	.pos-order-goods {
		padding: 32rpx 24rpx;
		border-radius: 24rpx;
		background: #FFFFFF;
	}

	.pos-order-goods.split {
		margin-top: 20rpx;
	}

	.pos-order-goods .title {
		height: 40rpx;
		margin-bottom: 32rpx;
		font-size: 28rpx;
		color: #333333;
	}

	.pos-order-goods .title .btn {
		font-size: 26rpx;
		color: #999999;
	}

	.pos-order-goods .title .btn .iconfont {
		font-size: 24rpx;
	}

	.pos-order-goods.split .goods {}

	.pos-order-goods .goods~.goods {
		margin-top: 32rpx;
	}

	.pos-order-goods .goods .picTxt {
		flex: 1;
		min-width: 0;
	}

	.pos-order-goods .goods .picTxt .pictrue {
		width: 136rpx;
		height: 136rpx;
	}

	.pos-order-goods .goods .picTxt .pictrue image {
		width: 100%;
		height: 100%;
		border-radius: 16rpx;
	}

	.pos-order-goods .goods .picTxt .text {
		flex: 1;
		min-width: 0;
		padding-left: 20rpx;
	}

	.pos-order-goods .goods .picTxt .text .info {
		font-size: 28rpx;
		line-height: 40rpx;
		color: #333333;
	}

	.pos-order-goods .goods .picTxt .text .info .label {
		color: #ff4c3c;
	}

	.pos-order-goods .goods .picTxt .text .attr {
		margin-top: 8rpx;
		font-size: 24rpx;
		line-height: 34rpx;
		color: #999999;
	}

	.pos-order-goods .goods .money {
		width: 144rpx;
		text-align: right;
	}

	.pos-order-goods .goods .money .writeOff {
		font-size: 24upx;
		margin-top: 17upx;
		color: #1890FF;
	}

	.pos-order-goods .goods .money .writeOff .on {
		color: #FF7E00;
	}

	.pos-order-goods .goods .money .x-money {
		color: #282828;
	}

	.pos-order-goods .goods .money .num {
		margin-top: 10rpx;
		font-size: 24rpx;
		line-height: 34rpx;
		color: #999999;
	}

	.pos-order-goods .goods .money .y-money {
		color: #999;
		text-decoration: line-through;
	}

	.public-total {
		font-size: 28upx;
		color: #282828;
		border-top: 1px solid #eee;
		height: 92upx;
		line-height: 92upx;
		text-align: right;
		padding: 0 30upx;
		background-color: #fff;
	}

	.public-total .money {
		color: #ff4c3c;
	}

	.copy-data {
		font-size: 10px;
		color: #333;
		-webkit-border-radius: 1px;
		border-radius: 1px;
		border: 1px solid #666;
		padding: 0px 7px;
		margin-left: 12px;
		height: 20px;
	}

	.pos-order-goods .mark {
		margin-top: 32rpx;
		font-size: 28rpx;
		line-height: 40rpx;
		color: #333333;

		.name {
			width: 136rpx;
		}

		.value {
			flex: 1;
		}
	}

	.mask {
		z-index: 21;
	}

	.confirm-popup {
		position: fixed;
		top: 50%;
		right: 75rpx;
		left: 75rpx;
		z-index: 21;
		transform: translateY(-50%);
		border-radius: 32rpx;
		background: #FFFFFF;
		text-align: center;

		.title {
			padding: 40rpx 32rpx 0;
			font-weight: 500;
			font-size: 32rpx;
			line-height: 52rpx;
			color: #333333;
		}

		.info {
			padding: 24rpx 40rpx 0;
			font-size: 30rpx;
			line-height: 42rpx;
			color: #666666;
		}

		.btn-box {
			padding: 40rpx;
		}

		.btn {
			flex: 1;
			height: 72rpx;
			border: 1rpx solid #2A7EFB;
			border-radius: 36rpx;
			margin-left: 32rpx;
			font-weight: 500;
			font-size: 26rpx;
			line-height: 70rpx;
			color: #2A7EFB;
			transform: rotateZ(360deg);

			&.primary {
				background: #2A7EFB;
				color: #FFFFFF;
			}
		}
	}

	.user-box {
		padding: 24rpx;
		border-radius: 24rpx;
		margin-top: 20rpx;
		background: #FFFFFF;

		.image {
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
		}

		.text {
			flex: 1;
			padding-left: 20rpx;
			font-size: 24rpx;
			line-height: 34rpx;
			color: #999999;
		}

		.name {
			margin-bottom: 4rpx;
			font-weight: 500;
			font-size: 28rpx;
			line-height: 40rpx;
			color: #333333;
		}

		.svip {
			width: 56rpx;
			height: 26rpx;
			border-radius: 14rpx;
			margin-left: 12rpx;
			background: linear-gradient(90deg, #484643 0%, #1F1B17 100%);
			text-align: center;
			font-weight: 600;
			font-size: 18rpx;
			line-height: 26rpx;
			color: #FDDAA4;
		}

		.grade {
			height: 26rpx;
			padding: 0 10rpx;
			border: 1rpx solid #FACC7D;
			border-radius: 14rpx;
			margin-left: 10rpx;
			background: #FEF0D9;
			font-weight: 500;
			font-size: 18rpx;
			line-height: 24rpx;
			color: #DFA541;
			transform: rotateZ(360deg);

			.iconfont {
				margin-right: 6rpx;
				font-size: 18rpx;
			}
		}
	}
 .customForm /deep/ .wrapper .item .conter {
  width: auto;
  }
 .edit-box{
   display: flex;
   justify-content: flex-end;
   margin-top: 10rpx;
   .btn{
     width: 144rpx;
     height: 56rpx;
     border: 1rpx solid #CCCCCC;
     line-height: 54rpx;
     text-align: center;
     border-radius: 28rpx;
     font-size: 24rpx;
     color: #333333;
     transform: rotateZ(360deg);
   }
 }
 .confirm-box{
   display: flex;
   justify-content: center;
   .btn{
     padding:0 30rpx;
     height: 56rpx;
     line-height: 54rpx;
     text-align: center;
     border-radius: 28rpx;
     font-size: 24rpx;
     background:#1b8ffa;
     color: #fff;
   }
 }
 .wrapper{
   .title{
     margin-bottom: 20rpx;
     font-size: 28rpx;
     font-weight: bold;
   }
 }
 .zu-box{
   .time-box{
     display: flex;
     flex-direction: column;
     align-items: center;
     >view{
       margin-bottom: 16rpx;
     }
     .green{
       background: #19be6b;
       color: #fff;
       padding: 4rpx 15rpx;
       border-radius: 10rpx;
     }
     .red{
       background: #fff1f0;
       border: 1rpx solid #f5222d;
       color: #f5222d;
       padding: 3rpx 15rpx;
       border-radius: 10rpx;
     }
   }
 }
.info-box{
  .item{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20rpx;
    .r{
      display: flex;
      align-items: center;
      .btn{
        color: #2d8cf0;
        margin-left: 10rpx;
      }
    }
  }
  .main{
    padding: 0 20rpx;
  }
  .border{
    border-bottom:1rpx solid #f5f5f5;
    margin-bottom: 20rpx;
    padding-bottom: 20rpx;
  }
}
.footer{
  .scroll-view{
    width: 100%;
    display: flex;
    align-items: center;
  }
}
.btn-color{
  white-space: nowrap;
  padding: 0 24rpx;
  height: 56rpx;
  line-height: 54rpx;
  text-align: center;
  border-radius: 28rpx;
  font-size: 24rpx;
  color: #fff;
  transform: rotateZ(360deg);
  background: #1497fa;
  margin-right: 20rpx;
}
.origin{
  background: #ff9900;
}
.blue-ghost{
  background: #fff;
  border: 1px solid #1497fa;
  color: #1497fa;
}
.red{
  border: 1px solid #ed4014;
  color: #ed4014;
  background: #fff;
}
.mdm-box{
  .main{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    .mdm-item{
      flex: 1 0 calc(33.33% - 20rpx);
      margin-bottom: 20rpx;
      .btn-color{
        //border-radius: ;
      }
    }
  }
}
.order-wrapper{
  .tag{
    color: #fff;
    line-height: 46rpx;
    min-width: 100rpx;
    padding: 0 10rpx;
    border-radius: 14rpx;
    font-size: 26rpx;
    text-align: center;
    background: #f7f7f7;
    border: 1rpx solid #ebedef;
  }
  .success{
    color: #19be6b;
  }
  .error{
    color: #ed4014;
  }
  .default{
    color: #1A1A1A;
  }
}
  /deep/.uni-scroll-view-content{
    display: flex;
  }

</style>